<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <meta http-equiv="X-UA-Compatible" content="IE=edge">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>Document</title>
  <style>
    .a{
      position: relative;
      width: 100px;
      height: 30px;
      transition: all .3s;
      transform-style: preserve-3d;
    }
    .a:hover{
      transform: rotateX(90deg);
    }
    .b{
      position: absolute;
      width: 100%;
      height: 100%;
      background-color: aqua;
      transform:translateY(15px) rotateX(-90deg);
    }
    .c{
      position: absolute;
      width: 100%;
      height: 100%;
      background-color:  rgb(255, 0, 0);
      transform: translateZ(15px)
    }
  </style>
</head>
<body>
  <div class="a">
    <div class="b">你好</div>
    <div class="c">嗨</div>
  </div>
</body>
</html>